package com.mysite.springcloud.demo.user.controller;

import com.mysite.springcloud.demo.api.vo.UserVo;
import com.mysite.springcloud.demo.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getByUsername")
    public UserVo index(@RequestParam String username) {
        return userService.getUser(username);
    }
}
